<extend name="Public/base"/>

<block name="body">
    <!-- 标题栏 -->
    <div class="main-title">
        <h2>{$meta_title}{$recycle}</h2>
    </div>
    <div class="clearfix">
        <div class="col-xs-10">
            <a class="btn btn-success" href="{:U('updatePay',array('a_type'=>'add'))}">新增</a>
            <button class="btn ajax-post btn-primary" url="{:U('setStatus',array('method'=>'resume','model'=>'core_pay_item'))}"
                    target-form="ids">激活
            </button>
            <button class="btn ajax-post btn-warning" url="{:U('setStatus',array('method'=>'forbid','model'=>'core_pay_item'))}"
                    target-form="ids">禁用
            </button>
            <button class="btn ajax-post btn-danger" url="{:U('setStatus',array('method'=>'delete','model'=>'core_pay_item'))}"
                    target-form="ids">删除
            </button>
            <a class="btn btn-success" href="{:U('updateBill',array('a_type'=>'add'))}">生成</a>
        </div>
        <!-- 高级搜索 -->
        <div class="search-form  col-xs-2 text-right">
            <div class="input-group">
                <input type="text" name="keyword" class="search-input form-control" value="{:I('keyword')}" placeholder="缴费母项名称">
                                 <span class="input-group-btn">  <a class="btn btn-default" href="javascript:;" id="search" url="{:U('index')}"><i class="icon-search"></i></a></span>
            </div>
        </div>
    </div>
    <!-- 数据列表 -->
    <div class="data-table with-padding">
        <table class="table table-bordered table-striped ">
            <thead>
            <tr>
                <th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
                <th class="">id</th>
                <th class="">所属单位</th>
                <th class="">缴费项名称</th>
                <th class="">缴费时间</th>
                <th class="">所属缴费项</th>
                <th class="">备注信息</th>
                <th class="">更新时间</th>
                <th class="">创建时间</th>
                <th class="">状态</th>
              
                <th class="">操作</th>
            </tr>
            </thead>
            
            <tbody>
            <notempty name="_list">
                <volist name="_list" id="vo">
                    <tr style="color:deepskyblue;border: 2px solid deepskyblue;background: rgba(93,200,205,1); font-family: '微软雅黑'; font-weight: bold;">
                        <td><input class="ids" type="checkbox" name="id[]" value="{$vo.id}"/></td>
                        <td style="background: rgba(93,200,205,0.5);">{$vo.id}</td>
                        <td>{$vo.utitle}</td>
                        <td>{$vo.title}</td>
                        <td>{$vo.start_date|time_format} 至 {$vo.end_date|time_format}</td>
                        <td>{$vo.pid}</td>
                        <td>{$vo.remark}</td>
                        <td>
                            <if condition="$vo.update_time neq 0">
                                {$vo.update_time|time_format}
                                <else/>
                                暂无
                            </if>
                        </td>
                        <td>{$vo.create_time|time_format}</td>
                        <td>
                            <if condition="$vo.status eq 1">
                                <span style="color:green;">启用</span>
                                <else/>
                                <span style="color:red;">禁用</span>
                            </if>
                        </td>
                        <style type="text/css">
                            .asd>a{
                               color:rgba(79,200,205,1); 
                            }
                         </style>
                        <td class="asd" >
                            <a class="status status_1" href="{:U('updateSubPay',array('pid'=>$vo[id],'ititle'=>$vo[title],'a_type'=>'add'))}">新增</a>
                            <a class="status status_1" href="{:U('updatePay',array('id'=>$vo[id],'a_type'=>'edit'))}">编辑</a>
                            <if condition="$vo.status neq 1">
                            <a class="status status_2 ajax-get" href="{:U('setStatus',array('method'=>'resume',id=>$vo[id],'model'=>'core_pay_item'))}">激活</a>
                            </if>
                            <if condition="$vo.status neq 2">
                            <a class="status status_4 ajax-get" href="{:U('setStatus',array('method'=>'forbid',id=>$vo[id],'model'=>'core_pay_item'))}">禁用</a>
                            </if>
                            <!-- <a class="status status_4 " href="{:U('setStatus',array('method'=>'delete',id=>$vo[id],'model'=>'core_pay_item'))}" onclick="javascript:if(confirm('确实要操作吗?')){return true;}else{return false;}">删除</a> -->
                        </td>
                    </tr>
                    <volist name="vo.sub" id="v">
                        <tr>
                            <td><input class="ids" type="checkbox" name="id[]" value="{$v.id}"/></td>
                            <td></td>
                            <td></td>
                            <td>{$v.title}</td>
                            <td>
                                <if condition=" $v.setstate eq 1 ">
                                    必选
                                </if>
                                <if condition=" $v.setstate eq 0 ">
                                    可选
                                </if>
                            </td>
                            <td>{$vo.title}</td>
                            <td>{$v.remark}</td>
                            <td>
                                <if condition="$v.update_time neq 0">
                                    {$v.update_time|time_format}
                                    <else/>
                                    暂无
                                </if>
                            </td>
                            <td>{$v.create_time|time_format}</td>
                            <td>
                                <if condition="$v.status eq 1">
                                    <span style="color:green;">启用</span>
                                    <else/>
                                    <span style="color:red;">禁用</span>
                                </if>
                            </td>
                            <td>
                                <a class="status status_1" href="{:U('updateSubPay',array('id'=>$v[id],'a_type'=>'edit'))}">编辑</a>
                                <if condition="$v.status neq 1">
                                <a class="status status_2 ajax-get" href="{:U('setStatus',array('method'=>'resume',id=>$v[id],'model'=>'core_pay_item'))}">激活</a>
                                </if>
                                <if condition="$v.status neq 2">
                                <a class="status status_4 ajax-get" href="{:U('setStatus',array('method'=>'forbid',id=>$v[id],'model'=>'core_pay_item'))}">禁用</a>
                                </if>
                                <a class="status status_4 " href="{:U('setStatus',array('method'=>'delete',id=>$v[id],'model'=>'core_pay_item'))}" onclick="javascript:if(confirm('确实要操作吗?')){return true;}else{return false;}">删除</a>
                            </td>
                        </tr>
                    </volist>
                </volist>
                <else/>
                <td colspan="10" class="text-center">{:L('_ADMIN_USER_EMPTY_')}</td>
            </notempty>
            </tbody>
        </table>
    </div>
    <div class="with-padding">
        {$_page}
    </div>
</block>

<block name="script">
    <script src="__CSS__/status.css"></script>
    <script src="__STATIC__/thinkbox/jquery.thinkbox.js"></script>
    
    <script type="text/javascript">
        //搜索功能
        $("#search").click(function () {
            var url = $(this).attr('url');
            var query = $('.search-form').find('input').serialize();
            query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
            query = query.replace(/^&/g, '');
            if (url.indexOf('?') > 0) {
                url += '&' + query;
            } else {
                url += '?' + query;
            }
            window.location.href = url;
        });
        //回车搜索
        $(".search-input").keyup(function (e) {
            if (e.keyCode === 13) {
                $("#search").click();
                return false;
            }
        });
        //导航高亮
    </script>
</block>